export const schema = {
    type: "page",
    title: "已结项项目",
    toolbar: {
        type: "button",
        actionType: "link",
        icon: "fa fa-plus pull-left",
        level: "success",
        label: "新建项目",
        visibleOn: 'acl.can("project:create")',
        link: "/project/create"
    },
    body: [
        {
            type: "nav",
            stacked: false,
            links: [
                {
                    label: "进行中",
                    to: "/project/my/processing"
                },
                {
                    label: "待审核",
                    to: "/project/my/pending",
                    visibleOn: 'acl.can("project:pending")'
                },

                {
                    label: "待提交",
                    to: "/project/my/draft"
                },

                {
                    label: "已结项",
                    to: "/project/my/outdated",
                    active: true
                }
            ]
        },
        {
            type: "wrapper",
            className: "b-l b-b b-r bg-white no-padder",
            body: {
                type: "crud",
                showHeader: false,
                api: "/api/project/outdated",
                panelClassName: "no-border no-shadow bg-white",
                footable: {
                    expand: "all"
                },
                columns: [
                    {
                        name: "name",
                        label: "项目名称",
                        innerClassName: "inline",
                        type: "tpl",
                        tpl: "<a data-link='/project/view/${id}'>${name}</a>"
                    },
                    {
                        label: "发起日期",
                        name: "created_at",
                        type: "tpl",
                        tpl: "${created_at|date:LL:YYYY-MM-DD HH:mm:ss}"
                    },
                    {
                        label: "报名截止日期",
                        name: 'join_end',
                        type: 'date'
                    },

                    {
                        label: "已报名 ／ 计划招募人数",
                        type: 'tpl',
                        tpl: "${join_people_count} / ${people_count}"
                    },

                    {
                        label: "结项原因",
                        type: "tpl",
                        tpl: "<% if (status == 0) { %>审批下架<% } else { %>过期下架<% } %>"
                    },

                    {
                        label: "",
                        type: "operation",
                        innerClassName: "clear btn-toolbar",
                        breakpoint: true,
                        buttons: [
                            {
                                type: "button",
                                label: "志愿时长管理",
                                level: "info",
                                size: "sm",
                                className: "pull-right",
                                actionType: "link",
                                link: "/project/work/${id}"
                            },
                            {
                                type: "button",
                                label: "签到码",
                                level: "info",
                                size: "sm",
                                className: "pull-right",
                                actionType: "link",
                                link: "/project/checkin/${id}"
                            },
                            {
                                type: "button",
                                label: "录用管理",
                                level: "info",
                                size: "sm",
                                className: "pull-right",
                                actionType: "link",
                                link: "/project/hire/${id}"
                            }
                        ]
                    }
                ]
            }
        }
    ]
};
